
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>autocomplete</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="./layui/css/layui.css" media="all" />
</head>
<body>
	<div class="layui-container">
		<br>
		<div class="layui-row">
			<div class="layui-col-md-offset4 layui-col-md4">
				<form class="layui-form" method="post">
					<div class="layui-form-item">
						<input type="text" class="layui-input" id="testInput1" name="title" autocomplete="off" placeholder="请输入标题">
					</div>
					<div class="layui-form-item">
						<input type="text" class="layui-input" id="testInput2" name="title" autocomplete="off" placeholder="请输入标题" value="555">
					</div>
				</form>
			</div>
		</div>

	</div>

	<script src="./layui/layui.js"></script>

	<script>
		layui.config({
			base : './layui_exts/'
		}).extend({
			autocompleteX : 'autocompleteX/autocompleteX'
		}).use([ 'layer', 'form', 'jquery', 'autocompleteX' ], function() {
			var $ = layui.jquery, form = layui.form, autocompleteX = layui.autocompleteX;

			autocompleteX.render({
				elem : '#testInput1',
				width : 300,
				data : [ '111', '222', '333', '444', '555', '666', '777', '888', '999', '000' ]
			});
			autocompleteX.render({
				elem : '#testInput2',
				width : 300,
				data : [ 'aaa', 'bbb', 'ccc', 'ddd', 'eee', 'fff', 'ggg', 'hhh', 'iii', 'jjj' ]
			});
		});
	</script>
</body>
</html>